<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class SitesController extends Controller
{
    //
    public function index() {
        return view('welcome');
    }

    public function about() {

        // with data
//        $name = "<span style = 'color:red;'>lfg.1st</span>";
//        return view('sites/about')->with([
//            'first'=>$name,
//            'last'=>'Bool'
//        ]);

        // $data方式
//        $data = [];
//        $data['first'] = 'lf_name';
//        $data['last'] = 'g_name';
//        return view('sites/about',$data);

        // compact方式
        $first = 'lf';
        $last = 'g';
        $people = ['Ray','James','Kobe'];
        return view('sites/about',compact('first','last','people'));
    }

    public function hel() {
        return 'i am glf';
    }

    public function contact() {
        return view('sites.contact');
    }
}
